package com.ning.cms.web.controller;

import com.ning.common.web.exception.CustomerException;
import com.ning.common.web.response.Result;
import com.ning.common.web.response.ResultCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
        return "Hello";
    }
    @GetMapping("/ex")
    public Result ex() throws Exception {
        throw new Exception("测试异常");
    }
    @GetMapping("/cuex")
    public Result cuex() throws Exception {
        throw new CustomerException(ResultCode.PARAM_IS_INVALID);
    }
}
